﻿using Dyao.Book.Contract;

namespace Dyao.Book.Application.Abstractions
{
    public interface IBookContentApplication
    {
        /// <summary>
        /// 获取正文列表
        /// </summary>
        /// <param name="chapterId">章节编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<List<BookContentDto>> GetListByChapterIdAsync(string chapterId, CancellationToken cancellationToken = default);

        /// <summary>
        /// 爬取内容
        /// </summary>
        /// <param name="bookId">书籍编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<bool> CrawlContentAsync(string bookId, CancellationToken cancellationToken);

        /// <summary>
        /// 手动爬取章节内容
        /// </summary>
        /// <param name="taskCenter">任务中心</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task CrawlContentAsync(TaskCenterDto taskCenter, CancellationToken cancellationToken);

        /// <summary>
        /// 手动爬取章节内容
        /// </summary>
        /// <param name="taskCenter">任务中心</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task ManualCrawlContentAsync(TaskCenterDto taskCenter, CancellationToken cancellationToken);
    }
}
